package com.example.testapp.activity.http;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

/**
 * Created by l on 2016/8/2.
 */
public class HttpUtil {
    public static boolean isNetWorkConnect(Context context) {

        ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo  networkInfo = manager.getActiveNetworkInfo();
        if(networkInfo == null || !networkInfo.isAvailable())
        return false;
        else {
            return true;
        }
    }
}
